#ifndef LI_TIMER_H
#define LI_TIMER_H


#ifdef __cplusplus
extern "C" {
#endif

#define Hz(x) (tick_freq/x)
#define Second(s) (tick_freq*s)

int32_t lily_tick(void);

void li_new_timer(Tasks_def task, uint32_t period);
void li_new_timer_arg(TasksArg_def task, uint32_t period, void *arg);

int32_t li_remove_timer(Tasks_def task);
int32_t li_remove_timer_arg(TasksArg_def task, void* arg);

int32_t timer_find(Tasks_def task);
int32_t timer_find_arg(TasksArg_def task, void* arg);
void* timer_find_arg_iteration(TasksArg_def task, int* iter, int * out_period);

void timer_change_period(Tasks_def task, unsigned int newPer);
void timer_arg_change_period(TasksArg_def task, void *arg, unsigned int newPer);

int32_t li_new_timer_once(Tasks_def task, int32_t count);
int32_t _quick_timer_change_count(Tasks_def timer, int32_t newCount);
int32_t li_new_timer_once_count(Tasks_def timer, int32_t newCount);



#ifdef __cplusplus
}
#endif

#endif
